<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
                xmlns:h="http://xmlns.jcp.org/jsf/html"
                xmlns:f="http://xmlns.jcp.org/jsf/core"
                xmlns:p="http://primefaces.org/ui"
                template="/WEB-INF/template.xhtml">

    <ui:define name="head">
        <script src="https://maps.google.com/maps/api/js?key=AIzaSyCvCDkYieuUBmMWon_mfLAfjuaeuosuqow&amp;sensor=false"></script>
    </ui:define>

    <ui:define name="title">
        GMap <span class="subitem">Info Window</span>
    </ui:define>

    <ui:define name="description">
        When a marker is selected, an info window can be displayed to provide detailed information.
    </ui:define>

    <ui:param name="documentationLink" value="/components/gmap"/>
    <ui:param name="widgetLink" value="GMap-1"/>

    <ui:define name="implementation">
        <div class="card">
            <h:form prependId="false">
                <p:gmap id="gmap" center="36.890257,30.707417" zoom="13" type="HYBRID"
                        model="#{infoWindowView.advancedModel}" style="width:100%;height:400px">

                    <p:ajax event="overlaySelect" listener="#{infoWindowView.onMarkerSelect}"/>

                    <p:gmapInfoWindow id="infoWindow">
                        <p:outputPanel style="text-align: center; display: block; margin: auto">

                            <p:graphicImage name="/demo/images/antalya/#{infoWindowView.marker.data}" height="150"/>
                            <br/>
                            <h:outputText value="#{infoWindowView.marker.title}"/>

                        </p:outputPanel>
                    </p:gmapInfoWindow>
                </p:gmap>

                <!-- Preload for demo -->
                <p:outputPanel style="display:none">
                    <p:graphicImage name="/demo/images/antalya/konyaalti.png"/>
                    <p:graphicImage name="/demo/images/antalya/ataturkparki.png"/>
                    <p:graphicImage name="/demo/images/antalya/kaleici.png"/>
                    <p:graphicImage name="/demo/images/antalya/karaalioglu.png"/>
                </p:outputPanel>
            </h:form>
        </div>
    </ui:define>

</ui:composition>
